The present invention relates to input and output functions of computer programs. More specifically, the present invention is related to enabling location independent and location transparent interaction between a program and a user, one or both of which is mobile.
To support interaction between a user and a program, current systems require the program and the user to be constantly aware of each other""s location. If a program, such as a mobile agent program, moves to a different host, it must return to the user location or communicate through another program at the user location, to receive input or display output to the user. This is a problem when the user is mobile (e.g., using a laptop or handheld device) and, therefore, usually not in the original location from which the program was launched. Similarly, if a user chooses to move to another location on a network, that user must access the machine at which the program is executing in order to provide input or to receive output from the program.
In prior art systems, interactions between a program and a user are handled using standard input and output constructs. For example, in C programming language the input construct is the xe2x80x9cscanf( )xe2x80x9d function and the output construct is the xe2x80x9cprintf( )xe2x80x9d function. In Java language, the input is performed using methods in classes such as xe2x80x9cjava.io.InputStreamReaderxe2x80x9d and xe2x80x9cjava.io.InputStream,xe2x80x9d while output is performed using methods in classes such as xe2x80x9cjava.io.PrintWriterxe2x80x9d and xe2x80x9cjava.io.PrintStream.xe2x80x9d For such programs, both the user and the program must be at the same location.
In conventional mobile agent systems, such as those described in U.S. Pat. No. 5,603,031, issued Feb. 11, 1997, entitled xe2x80x9cSystem and Method for Distributed Computation Based Upon the Movement, Execution, and Interaction of Processes in a Network,xe2x80x9d by White et al. and xe2x80x9cIBM Aglets Workbenchxe2x80x94Programming Mobile Agents in Javaxe2x80x9d, Proceedings of 1997 World Wide Computing and Its Applications, Japan, pp. 253-266 by Lange et al., the program executes part of its code at one host location, then moves to another host location where it executes a next portion of code, and so on. Interaction between a mobile agent and a user in such a system is achieved by the agent moving to and executing at the user""s machine when display of data to the user and/or receipt of input from the user is required.
The conventional systems have three main limitations. First, both the program and the user have to be aware of each others"" location at all times. Second, in situations where a program must move to the location of a user, the user""s machine must have a program execution environment available to host and execute the program at any time. Third, while mechanisms exist to supply initialization parameters to a program before it begins execution, after the program has started execution, there are no mechanisms in these systems to permit a user to both determine the status of the program and to provide input to the program during program execution and/or before the program asks for them.
An object of the present invention is to provide a system and method for permitting input and output between a user and a program without the requirement of each entity constantly maintaining knowledge of the other entity""s location.
Another object of the present invention is to provide a system and method for permitting input and output between a user and a program without requiring the user""s machine to have an execution environment available in which the program can run.
Another object of the present invention is to provide for a user to both determine the status of a mobile program during execution and supply input to a program during execution and before input is actually needed.
These and other objects of the invention are realized by the present invention comprising a system and method wherein a mobile user, or a user interacting with a mobile program, can at any time initiate a program status request. The program status request initiates the sequence of events whereby the current location of the program is determined and/or the current user location is made available to the program without the necessity of either entity changing location. Further, the agent script for the program maintains a composite data structure which includes an input buffer for storing input variables, an output buffer for storing output values to be displayed to the user, a program state data structure, and an optional bag buffer for temporarily storing input values which the program will need in the course of future execution. By maintaining such a composite data structure, it is assured that all necessary information can be provided at a program location regardless of whether the program or the user has relocated.